FROM registry.gitee-ai.local/base/iluvatar-corex:3.2.0-bi100
ENV DEBIAN_FRONTEND=noninteractive \
    TZ=America/Los_Angeles
ARG USE_PERSISTENT_DATA
#python3 python3-pip
RUN apt-get update && apt-get install -y \
    git  \
    make build-essential libssl-dev zlib1g-dev \
    libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
    libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev git git-lfs  \
    ffmpeg libsm6 libxext6 cmake libegl1 \
    && rm -rf /var/lib/apt/lists/* \
    && git lfs install
WORKDIR /app
COPY ./requirements.txt /code/requirements.txt
# User
#RUN useradd -m -u 1000 user
#USER user
#ENV HOME=/home/user \
#    PATH=/home/user/.local/bin:$PATH
#
RUN pip3 install --no-cache-dir  -r /code/requirements.txt --extra-index-url https://mirrors.cloud.tencent.com/pypi/simple
#
#WORKDIR $HOME/app
COPY . .
RUN echo "Done"
#/home/user/app/data
ENV PT_SDPA_ENABLE_IXDNN=0
ENV SDPA_ENABLE_HEAD_DIM_PADDING=1
RUN pip list
RUN python3 --version
CMD ["python3", "main.py", "--listen", "0.0.0.0", "--port", "7860", "--output-directory", "./data/"]